package com.meelive.ingkee.push;

import android.app.Activity;
import android.content.Context;

import com.heytap.msp.push.HeytapPushManager;
import com.meelive.ingkee.push.common.PushUtils;
import com.meelive.ingkee.push.model.InkePushType;
import com.meizu.cloud.pushsdk.util.MzSystemUtils;
import com.vivo.push.PushClient;

/**
 * Create by: fanfeiyue
 * on: 2019-09-28
 * desc:
 */
public class InkePushManage {

    public static void init(Context context, InkePushConfig config) {
        InkePushHelper.getInstance().init(context, config);
    }

    public static InkePushType getPushType() {
        return InkePushHelper.getInstance().getPushType();
    }

    public static String getPushToken() {
        return InkePushHelper.getInstance().getPushToken();
    }

    public static String getJPushToken() {
        return InkePushHelper.getInstance().getJPushToken();
    }

    public static void setDebugMode(boolean isDebug) {
        PushUtils.DEBUG = isDebug;
    }

    public static InkePushConfig getPushConfig() {
        return InkePushHelper.getInstance().getPushConfig();
    }

    public static void unregister(boolean unbindToken) {
        InkePushHelper.getInstance().unregister(unbindToken);
    }

    public static boolean isSupportOPush(Context context) {
        try {
            return HeytapPushManager.isSupportPush(context);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

    public static boolean isSupportVPush(Context context) {
        try {
            return PushClient.getInstance(context).isSupport();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

    public static boolean isSupportMZPush(Context context) {
        try {
            return MzSystemUtils.isBrandMeizu(context);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

    public static boolean isNotificationEnabled(Context context) {
        return PushUtils.isNotificationEnabled(context);
    }

    public static void openPushSwitch(Activity activity) {
        PushUtils.openPushSwitch(activity);
    }
}
